import {FLAG_STORAGE} from "../expand/dao/DataStore";
import {FAVORITE_KEY_PREFIX} from '../expand/dao/FavoriteDao'

export function checkFavorite(item, keys, favoriteDao) {
    if (keys.length < 1) return false
    return keys.some(function (key) {
        if (favoriteDao.favoriteKey === FAVORITE_KEY_PREFIX + FLAG_STORAGE.flag_popular) {
            return item.id.toString() === key
        } else {
            return item.fullName === key
        }
    })
}
